package com.lc.luzhengtang.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lc.luzhengtang.R;
import com.lc.luzhengtang.bean.OrderListBean;
import com.lc.luzhengtang.conn.Conn;
import com.zcx.helper.scale.ScaleScreenHelperFactory;

import java.util.List;

/**
 * https://github.com/CymChad/BaseRecyclerViewAdapterHelper
 */
public class SectionItem_List_Adapter extends BaseQuickAdapter<OrderListBean.DataBean.OrderslistBean, BaseViewHolder>  implements View.OnClickListener{

    List<OrderListBean.DataBean.OrderslistBean> data;

    public SectionItem_List_Adapter(List<OrderListBean.DataBean.OrderslistBean> data) {
        super(R.layout.item_order_secotion, data);
        this.data = data;
    }


    @Override
    protected void convert(BaseViewHolder helper,OrderListBean.DataBean.OrderslistBean item) {
        ScaleScreenHelperFactory.getInstance().loadView((ViewGroup) helper.convertView);


        Glide.with(mContext).load(Conn.HOST3+item.getPicurl()).crossFade().error(R.mipmap.zhanwei).placeholder(R.mipmap.zhanwei).into((ImageView) helper.getView(R.id.img_shop));
        helper.setText(R.id.text_newstime, item.getGoods_title());
        helper.setText(R.id.text_newstitle, "￥"+item.getGoods_price());

        helper.setText(R.id.text_big_small, item.getGoods_attr());
        helper.setText(R.id.text_count, "X"+item.getNum()+"");

        helper.addOnClickListener(R.id.layout_item);


    }

    @Override
    public void onClick(View v) {

    }
}
